﻿using System;

namespace Triangle01
{
    class Program
    {
        /// <summary>
        /// 输出一个直角三角形
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
           
            int intN = -1;
            while (intN < 0)

            {
                Console.Write("请输入行数（0表示结束):");
                string strN = Console.ReadLine();
                
                int.TryParse(strN, out intN);
            }
            if (intN > 0) 
            {
                for (int i = 1; i <= intN; i++)
                {
                    for (int j = 1; j < i; j++)
                    {
                        Console.Write("*");
                    }
                    Console.WriteLine("");
                }

            }
            
            Console.WriteLine("按任意键结束···");
            Console.ReadKey();
        }
    }
}